<!DOCTYPE html>    
<html lang="en">    
<head>    
    <meta charset="UTF-8">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0">    
    <title>乘法口诀表</title>    
    <style>    
        table {    
            width: 50%;     
            border-collapse: collapse;    
            margin: 0 auto;    
        }    
        td, th {    
            border: 1px solid black;    
            text-align: center;    
            padding: 5px;    
        }    
    </style>    
</head>    
<body>    
    <table id="cheng">    
        <script>    
            let tableHTML = '<tr>'; 
    
            for (let i = 1; i <= 9; i++) {    // 开始新行，并添加行标题    
                for (let b = 1; b <= i; b++) {    
                    tableHTML += `<td>${b}×${i}=${b*i}</td>`; // 添加乘法结果    
                }    
                tableHTML += '</tr>'; // 结束当前行    
            }    
    
            document.getElementById("cheng").innerHTML = tableHTML; // 将生成的HTML插入到表格中    
        </script>    
    </table>    
</body>    
</html>